import { axios } from '@/utils/request'

const prefix = '/basePaymentMethods'


/**
 * 高级查询
 * @param params
 * @returns {AxiosPromise}
 */
export function superPageFetchList(params) {
  return axios({
    url: prefix + '/selectAll',
    method: 'GET',
    params: {
      ...params
    }
  })
}


/**
 * 新增
 * @param params
 * @returns {AxiosPromise}
 */
export function addObj(params) {
  return axios({
    url: prefix + '/newInsert',
    method: 'POST',
    data: {
      ...params
    }
  })
}

/**
 * 删除
 * @param id
 * @returns {AxiosPromise}
 */
export function delObj(id) {
  return axios({
    url: prefix + '/delById/' + id,
    method: 'GET'
  })
}
/**
 * 获取详情
 * @param id
 * @returns {AxiosPromise}
 */
export function getObj(id) {
  return axios({
    url: prefix + '/getInfoById/' + id,
    method: 'GET'
  })
}


/**
 * 修改
 * @param params
 * @returns {AxiosPromise}
 */
export function putObj(params) {
  return axios({
    url: prefix + '/updateMethods',
    method: 'POST',
    data: {
      ...params
    }
  })
}
/**
 * 仓库下拉表
 * @param
 * @returns {AxiosPromise}
 */
export function dropDown() {
  return axios({
    url: prefix + '/dropDown',
    method: 'GET'
  })
}
/**
 * 下载模板
 * @returns {AxiosPromise}
 */
export function downloadExcelCandidate() {
  return axios({
    url: prefix + '/downloadExcel',
    method: 'get',
    responseType: 'arraybuffer'
  })
}
/**
 * 导出
 * @param params
 * @returns {*}
 */
export function exportData(params) {
  return axios({
    url: prefix + `/exportBySelect`,
    method: 'GET',
    params: params,
    responseType: 'blob'
  })
}

export function dropDownPayType () {
  return axios({
    url: prefix + `/dropDownPayType`,
    method: 'GET'
  })
}
